package cn.cuilan;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * SpringBoot启动类，包扫描
 *
 * @author zhang.yan
 */
@SpringBootApplication(scanBasePackages = {"cn.cuilan"}, excludeName = {""})
// web相关，servlet、filter等相关配置
@ServletComponentScan(basePackages = "cn.cuilan")
// 开启缓存支持
@EnableCaching
public class ApplicationAdmin {

    /**
     * 日志记录器
     * slf4j日志抽象包提供Logger接口，由LoggerFactory工场获取具体日志，如logback、log4j等。
     */
    private static final Logger logger = LoggerFactory.getLogger(ApplicationAdmin.class);

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(ApplicationAdmin.class, args);
        logger.debug("xiaozhu-admin [" + context.getId() + "] is started...");
    }

}
